xen.git
17 years agominios: Clip memory not usable by Mini-OS (above 1GB)
Keir Fraser [Fri, 5 Dec 2008 13:06:57 +0000 (13:06 +0000)]
minios: Clip memory not usable by Mini-OS (above 1GB)

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
17 years agocpuidle: revise tsc-save/restore to reduce tsc skew between cpus
Keir Fraser [Fri, 5 Dec 2008 13:03:44 +0000 (13:03 +0000)]
cpuidle: revise tsc-save/restore to reduce tsc skew between cpus

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovga: Clear the screen when relinquishing VGA to dom0.
Keir Fraser [Fri, 5 Dec 2008 11:37:20 +0000 (11:37 +0000)]
vga: Clear the screen when relinquishing VGA to dom0.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxentrace: trace interrupt window
Keir Fraser [Fri, 5 Dec 2008 11:05:45 +0000 (11:05 +0000)]
xentrace: trace interrupt window

Make a specific interrupt-window trace, with information about why the
interrupt in question can't be delivered.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
17 years agoVT-d code cleanup
Keir Fraser [Fri, 5 Dec 2008 10:59:41 +0000 (10:59 +0000)]
VT-d code cleanup

This patch narrow context caching flush range from the
domain-selective to the device-selective, when unmapping a device.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Fri, 5 Dec 2008 06:47:19 +0000 (15:47 +0900)]
merge with xen-unstable.hg

17 years agoIA64: implement PHYSDEVOP_pirq_eoi_gmfn and related stuff.
Isaku Yamahata [Fri, 5 Dec 2008 06:43:08 +0000 (15:43 +0900)]
IA64: implement PHYSDEVOP_pirq_eoi_gmfn and related stuff.

This patch is ia64 counter part of 18844:c820bf73a914.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoIA64: eliminate NR_IRQ_VECTORS. ia64 part.
Isaku Yamahata [Fri, 5 Dec 2008 06:43:06 +0000 (15:43 +0900)]
IA64: eliminate NR_IRQ_VECTORS. ia64 part.

This is ia64 counter part of 18802:935bd48f096a which eliminates
NR_IRQ_VECTORS.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agodocs: Add description of BUILD_BUG_ON().
Keir Fraser [Thu, 4 Dec 2008 16:36:43 +0000 (16:36 +0000)]
docs: Add description of BUILD_BUG_ON().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix one timer range issue
Keir Fraser [Thu, 4 Dec 2008 14:12:08 +0000 (14:12 +0000)]
Fix one timer range issue

According to the timer sematic, the timer can be executed at any timer
within [expires, expires_end], however, current implementation only allow
timer to be executed after expires_end, which is not conform to the timer
semantics.

This patch fix the the SPECpower score regression (~5% downgrade)
introduced by changeset 18744 "Change timer implementation to allow
variable 'slop'"

Signed-off-by: Yu Ke <ke.yu@intel.com>
17 years agoNew document on error handling in Xen.
Keir Fraser [Thu, 4 Dec 2008 12:35:22 +0000 (12:35 +0000)]
New document on error handling in Xen.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix existence check for MMIO-mapped 16550 UARTs
Keir Fraser [Thu, 4 Dec 2008 11:36:18 +0000 (11:36 +0000)]
Fix existence check for MMIO-mapped 16550 UARTs

Changeset 982e6fce0e47 added an existence test for UARTs.
Unfortunately, the existence test happens before MMIO UARTs are
ioremapped, therefore it may not be probing where it thinks it's
probing.  Rather than moving more code around, I think it's probably
safe to assume the arch code knows what it's doing if it passes in an
MMIO UART.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
17 years agoxm: Fix xm block-list for inactive managed domains
Keir Fraser [Thu, 4 Dec 2008 11:32:43 +0000 (11:32 +0000)]
xm: Fix xm block-list for inactive managed domains

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoxend: Remember bootloader settings in xenstore
Keir Fraser [Thu, 4 Dec 2008 11:31:37 +0000 (11:31 +0000)]
xend: Remember bootloader settings in xenstore

When xend is restarted, bootloader settings of all running domains are
lost. The attached patches fixes this by saving bootloader and
bootloader_args to xenstore database.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Thu, 4 Dec 2008 02:01:53 +0000 (11:01 +0900)]
merge with xen-unstable.hg

17 years agoxentop: Fix xentop for blktap
Keir Fraser [Wed, 3 Dec 2008 15:58:23 +0000 (15:58 +0000)]
xentop: Fix xentop for blktap

Blktap devices information isn't shown by xentop currently.

xen-unstable c/s 17813 said "blktap devices have statistics
counters (e.g., rd_req, wr_req, oo_req) prepended by tap_".
In fact, it is as follows.

# ls -l /sys/devices/xen-backend/tap-1-769/statistics/
total 0
-r--r--r-- 1 root root 4096 Dec  3 20:37 oo_req
-r--r--r-- 1 root root 4096 Dec  3 20:37 rd_req
-r--r--r-- 1 root root 4096 Dec  3 20:37 rd_sect
-r--r--r-- 1 root root 4096 Dec  3 20:37 wr_req
-r--r--r-- 1 root root 4096 Dec  3 20:37 wr_sect

The statistics counters haven't had "tap_" because it was removed
by linux-2.6.18-xen c/s 34.

This patch reverts xen-unstable c/s 17813, then we can get the
blktap devices information by using xentop.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoAMD IOMMU: Invalidate all pages on domain destruction
Keir Fraser [Wed, 3 Dec 2008 15:56:33 +0000 (15:56 +0000)]
AMD IOMMU: Invalidate all pages on domain destruction

Attached patch adds support to invalidate all pages associated with
the same domain ID on domain destruction.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoAMD IOMMU: Propagate HyperTransport settings from IVHD table to control register
Keir Fraser [Wed, 3 Dec 2008 15:56:05 +0000 (15:56 +0000)]
AMD IOMMU: Propagate HyperTransport settings from IVHD table to control register

Attached patch propagate HyperTransport settings suggested by IVHD
table to iommu control register(MMIO offset 0018h).

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoAMD IOMMU: Fix event log interrupt handling
Keir Fraser [Wed, 3 Dec 2008 15:55:32 +0000 (15:55 +0000)]
AMD IOMMU: Fix event log interrupt handling

Reset EventLogInt bit in iommu status register(MMIO offset 2020h) in
event log interrupt handler, to show software has handled the
interrupt. Completion wait interrupt is disabled.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoFix the HVM save hypercall to avoid freeing an uninitalised pointer.
Keir Fraser [Wed, 3 Dec 2008 15:54:24 +0000 (15:54 +0000)]
Fix the HVM save hypercall to avoid freeing an uninitalised pointer.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoDo not request domain shutdown if in S3 state during domain save.
Keir Fraser [Wed, 3 Dec 2008 15:12:19 +0000 (15:12 +0000)]
Do not request domain shutdown if in S3 state during domain save.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agophysdev: make PHYSDEVOP_pirq_eoi_mfn use of gmfn instead of mfn.
Keir Fraser [Wed, 3 Dec 2008 11:44:47 +0000 (11:44 +0000)]
physdev: make PHYSDEVOP_pirq_eoi_mfn use of gmfn instead of mfn.

To pass a page from a guest to hypervisor, gmfn should be used
instead of mfn like grant table and other hypercalls. It's more
consistent. So make use of gmfn instead of mfn for
PHYSDEVOP_pirq_eoi_mfn hypercall.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix mfn_to_virt() to cast MFN to address size.
Keir Fraser [Wed, 3 Dec 2008 11:38:36 +0000 (11:38 +0000)]
x86: Fix mfn_to_virt() to cast MFN to address size.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: No need for short jmp before long hjmp when setting CR0.PE
Keir Fraser [Wed, 3 Dec 2008 11:21:34 +0000 (11:21 +0000)]
x86: No need for short jmp before long hjmp when setting CR0.PE
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoIA64: Rationalize VMM mode alignment checking
Isaku Yamahata [Wed, 3 Dec 2008 02:43:54 +0000 (11:43 +0900)]
IA64: Rationalize VMM mode alignment checking

This is the xen port of ia64 linux chageset of
b704882e70d87d7f56db5ff17e2253f3fa90e4f3

    [IA64] Rationalize kernel mode alignment checking

    Itanium processors can handle some misaligned data accesses. They
    also provide a mode where all such accesses are forced to trap. The
    kernel was schizophrenic about use of this mode:

    * Base kernel code ran in permissive mode where the only traps
      generated were from those cases that the h/w could not handle.
    * Interrupt, syscall and trap code ran in strict mode where all
      unaligned accesses caused traps to the 0x5a00 unaligned reference
      vector.

    Use strict alignment checking throughout the kernel, but make
    sure that we continue to let user mode use more relaxed mode
    as the default.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoxenpmd: Adjust strncat() length to avoid static buffer overflow.
Keir Fraser [Tue, 2 Dec 2008 22:17:22 +0000 (22:17 +0000)]
xenpmd: Adjust strncat() length to avoid static buffer overflow.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix Xen panic with oprofile
Keir Fraser [Tue, 2 Dec 2008 11:53:24 +0000 (11:53 +0000)]
Fix Xen panic with oprofile

The attached patch fixes a Xen panic when a domain is shutdown before
oprofile is stopped. Without this patch, free_xenoprof_pages() is
called before the domain is destroyed and that, in turn, prevents
oprofile from cleaning up pages shared with guests. Shutting down a
domain without terminating oprofile therefore causes a Xen panic at a
later point in time.

Signed-off-by: Niraj Tolia <niraj.tolia@hp.com>
17 years agopvgrub: value returned by getrtsecs should be BCD
Keir Fraser [Mon, 1 Dec 2008 13:45:46 +0000 (13:45 +0000)]
pvgrub: value returned by getrtsecs should be BCD

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix PHYSDEVOP_pirq_eoi_mfn, which I modified and broke.
Keir Fraser [Sat, 29 Nov 2008 09:07:52 +0000 (09:07 +0000)]
x86: Fix PHYSDEVOP_pirq_eoi_mfn, which I modified and broke.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: remove unused parameter/arguments from flush_ready_eoi()
Keir Fraser [Fri, 28 Nov 2008 13:28:16 +0000 (13:28 +0000)]
x86: remove unused parameter/arguments from flush_ready_eoi()

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: add a shared page indicating the need for an EOI notification
Keir Fraser [Fri, 28 Nov 2008 13:27:32 +0000 (13:27 +0000)]
x86: add a shared page indicating the need for an EOI notification

To simplify the interface for the guest, when a guest uses this new
(sub-)hypercall, PHYSDEVOP_eoi behavior changes to unmask the
corresponding event channel at once, avoiding the eventual need for a
second hypercall from the guest.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Fix device release for tap devices
Keir Fraser [Fri, 28 Nov 2008 13:05:58 +0000 (13:05 +0000)]
xend: Fix device release for tap devices

I saw an error message when I shut down a domain.  The error
message showed that release of device(vbd/51712) failed.  But the
device was tap, was not vbd.  I think that a cause of the error message is
because _releaseDevices() calls destroyDevice() by wrong device class.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoxm: Relax the sanity check on guest configuration with XSM-ACM addlabel
Keir Fraser [Fri, 28 Nov 2008 13:04:30 +0000 (13:04 +0000)]
xm: Relax the sanity check on guest configuration with XSM-ACM addlabel

The attached patch relaxes the sanity check on guest configuration
when assigning a acm label to the guest. This patch makes a guest
configuration accept a bootloader parameter. This is common for
paravirtualized guests to boot them by using pygrub.

Signed-off-by: INAKOSHI Hiroya <inakoshi.hiroya@jp.fujitsu.com>
17 years agoshadow: fix the fix for promotion/resync race.
Keir Fraser [Fri, 28 Nov 2008 12:02:43 +0000 (12:02 +0000)]
shadow: fix the fix for promotion/resync race.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
17 years agox86_emulate: Fix for test harness and simplify some opcodes.
Keir Fraser [Thu, 27 Nov 2008 16:22:14 +0000 (16:22 +0000)]
x86_emulate: Fix for test harness and simplify some opcodes.

 - Need to use EFLG_DF rather than EF_DF
 - No need to force EAX destination for many opcodes, as this will be
   the default behaviour for DstReg with no ModRM.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAvoid warn_unused_result build failure on fgets().
Keir Fraser [Thu, 27 Nov 2008 12:43:25 +0000 (12:43 +0000)]
Avoid warn_unused_result build failure on fgets().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, hpet: check hpet existence
Keir Fraser [Thu, 27 Nov 2008 11:24:52 +0000 (11:24 +0000)]
x86, hpet: check hpet existence

Add check on hpet existence which is removed accidentally
in previous changeset (18790). Or else BAD PERIOD error can be seen.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
17 years agoVT-d code cleanup
Keir Fraser [Thu, 27 Nov 2008 11:22:38 +0000 (11:22 +0000)]
VT-d code cleanup

- remove a printk line. This printk may be output too many on some
  platforms, thus result in hang during dom0 booting.
- add write buffer flush in domain_context_unmap_one()
- when map/unmap context, if context is not flushed, needn't to flush
  iotlb

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoshadow: set fast_emul to zero when emulating to an out-of-sync page.
Keir Fraser [Thu, 27 Nov 2008 11:21:19 +0000 (11:21 +0000)]
shadow: set fast_emul to zero when emulating to an out-of-sync page.

A small missing thing on the original out of sync patch.
No real bug, but it's better to correctly specify the path.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
17 years agoMerge with ia64 tree.
Keir Fraser [Wed, 26 Nov 2008 11:14:26 +0000 (11:14 +0000)]
Merge with ia64 tree.

17 years agotimer: Print timer fn when dump timer queue
Keir Fraser [Wed, 26 Nov 2008 11:11:26 +0000 (11:11 +0000)]
timer: Print timer fn when dump timer queue

Print timer fn when dump timer queue, which would be
useful to understand type of the timer.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

17 years agovtd: cleanups
Keir Fraser [Wed, 26 Nov 2008 11:08:45 +0000 (11:08 +0000)]
vtd: cleanups

 - potential issues in vtd_page_fault() handler
 - wrong print messages
 - existing ATS code in dmar.c.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agoxen: Fix gcc 4.3 build failure.
Keir Fraser [Wed, 26 Nov 2008 11:07:44 +0000 (11:07 +0000)]
xen: Fix gcc 4.3 build failure.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Wed, 26 Nov 2008 01:23:49 +0000 (10:23 +0900)]
merge with xen-unstable.hg

17 years agoFix PSE PAT handling in guest walk.
Keir Fraser [Tue, 25 Nov 2008 11:17:57 +0000 (11:17 +0000)]
Fix PSE PAT handling in guest walk.

Guest walk was currently checking for _PAGE_PSE_PAT flag in
guest_l2e_get_flags(). The problem is that this function only checks
for the first 12 bits of the PDE, while _PAGE_PSE_PAT is actually on bit
12 (that is the 13th bit). This caused _PAGE_PAT bit to never been set on
splintered L1s.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
17 years agomerge with xen-unstable.hg
Isaku Yamahata [Tue, 25 Nov 2008 05:21:24 +0000 (14:21 +0900)]
merge with xen-unstable.hg

17 years agohvmloader: Pass BDF to PCI option ROMs.
Keir Fraser [Mon, 24 Nov 2008 13:57:48 +0000 (13:57 +0000)]
hvmloader: Pass BDF to PCI option ROMs.

Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agohvmloader: Load physical PCI option ROMs where available.
Keir Fraser [Mon, 24 Nov 2008 13:43:28 +0000 (13:43 +0000)]
hvmloader: Load physical PCI option ROMs where available.

Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agohvmloader: Relocate the etherboot ROM to be near the end of VGA
Keir Fraser [Mon, 24 Nov 2008 11:17:44 +0000 (11:17 +0000)]
hvmloader: Relocate the etherboot ROM to be near the end of VGA
BIOS. Current Xen hard coded VGA ROM at 0xC0000 and etherboot ROM
at 0xD0000. This makes the space in [0xC0000 - 0xDFFFF] to be
fragments, which makes it hard to find enough space to hold another
Option ROM.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
17 years agoshadow: fix race between resync and page promotion.
Keir Fraser [Mon, 24 Nov 2008 11:12:20 +0000 (11:12 +0000)]
shadow: fix race between resync and page promotion.

This patch fixes a (hopefully) rare-occurring problem causing memory
corruption in 64 bit guests (and assertion failures in debug build
xen).

On a pagefault, set_l{3,4}e's resync_all was able to give write access
to a page in the guest still not shadowed.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
17 years agopv-on-hvm drivers: build fixes for Linux 2.6.27+
Keir Fraser [Mon, 24 Nov 2008 11:11:20 +0000 (11:11 +0000)]
pv-on-hvm drivers: build fixes for Linux 2.6.27+

Make the drivers build properly in a 2.6.27 environment as well as
against a kernel with pv-ops Xen configured on (in the latter case
more work would be needed to also make the drivers work, as there's a
large number of duplicate exports).

Portions from Charles Arnold <carnold@novell.com>.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoPCI interface changes for PCIE-AER enabling
Keir Fraser [Mon, 24 Nov 2008 11:06:16 +0000 (11:06 +0000)]
PCI interface changes for PCIE-AER enabling

This patch reflects some pci interface changes in pciif.h in XEN head
file. And also add domain shutdown support in xend for shutting domain
from DOM0 kernel when non-recoverable uncorrected pci error happens.

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Ke Liping <liping.ke@intel.com>
17 years agox86: make NR_IRQS build-time configurable
Keir Fraser [Thu, 20 Nov 2008 14:23:59 +0000 (14:23 +0000)]
x86: make NR_IRQS build-time configurable

While keeping the NR_IRQS default at 256 here, I think it would be a
good thing to set it to a higher value to make sure no new mixing of
irq and vector spaces slip in.

Tested with NR_IRQS forced to 1024.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoEliminate NR_IRQ_VECTORS
Keir Fraser [Thu, 20 Nov 2008 14:23:33 +0000 (14:23 +0000)]
Eliminate NR_IRQ_VECTORS

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoProperly distinguish irq and vector spaces
Keir Fraser [Thu, 20 Nov 2008 14:22:54 +0000 (14:22 +0000)]
Properly distinguish irq and vector spaces

This makes sure that there are no assumptions about NR_IRQS==NR_VECTORS
anymore, and it also renames various variables to properly reflect
what they represent.

While coded correctly, I wonder whether dump_irqs() shouldn't iterate
over the vector space rather than the irq space, so that MSI entries
are also processed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: freeze non-current vCPUs of dom0 before entering S5
Keir Fraser [Thu, 20 Nov 2008 14:21:17 +0000 (14:21 +0000)]
x86: freeze non-current vCPUs of dom0 before entering S5

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoxend: Make _setCPUAffinity() errors nonfatal on domain resume
Keir Fraser [Thu, 20 Nov 2008 14:17:09 +0000 (14:17 +0000)]
xend: Make _setCPUAffinity() errors nonfatal on domain resume

This patch allows domains to be resumed on different number of CPUs. After
c/s 18764, a domain cannot be resumed when _setCPUAffinity() fails, which
happens when affinity should be set to a non-existent CPU. This patch
makes _setCPUAffinity() errors nonfatal.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
17 years agox86, hpet: Fix initialisation of secondary timers.
Keir Fraser [Thu, 20 Nov 2008 14:15:50 +0000 (14:15 +0000)]
x86, hpet: Fix initialisation of secondary timers.

Each channel may have different settings, and in the original
implementation, other Tn configuration will accidently overwrite T0
configuration.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
17 years agoxenapi: fix valid_object typo
Keir Fraser [Thu, 20 Nov 2008 14:14:20 +0000 (14:14 +0000)]
xenapi: fix valid_object typo

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
17 years agox86: Fix build for some versions of gcc.
Keir Fraser [Wed, 19 Nov 2008 19:13:22 +0000 (19:13 +0000)]
x86: Fix build for some versions of gcc.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: secure ioapic_guest_write() against FREE_TO_ASSIGN irq values
Keir Fraser [Wed, 19 Nov 2008 16:11:39 +0000 (16:11 +0000)]
x86: secure ioapic_guest_write() against FREE_TO_ASSIGN irq values

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: support CPUID hypervisor feature bit
Keir Fraser [Wed, 19 Nov 2008 16:10:39 +0000 (16:10 +0000)]
x86: support CPUID hypervisor feature bit

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, s3: Sync platform stamps at time suspend.
Keir Fraser [Wed, 19 Nov 2008 13:17:31 +0000 (13:17 +0000)]
x86, s3: Sync platform stamps at time suspend.

platform_timer_stamp and stime_platform_stamp are synced
to platform timer in time calibration (1s interval), and
thus doesn't reflect the latest value. If they're not
synced at time suspend, the offset can be lost after S3
resume. Average 0.8s lag-behind is observed for each S3
action, which accumulates to TOD inaccuracy.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

17 years agoRemove Xen-private definitions from kexec public header.
Keir Fraser [Wed, 19 Nov 2008 13:13:39 +0000 (13:13 +0000)]
Remove Xen-private definitions from kexec public header.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxen s3, No need to check idle vcpu before update_vcpu_system_time().
Keir Fraser [Wed, 19 Nov 2008 12:52:03 +0000 (12:52 +0000)]
xen s3, No need to check idle vcpu before update_vcpu_system_time().

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
17 years agox86, hpet: Avoud double initialisation on boot or after S3.
Keir Fraser [Wed, 19 Nov 2008 12:48:31 +0000 (12:48 +0000)]
x86, hpet: Avoud double initialisation on boot or after S3.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix the clocksource= boot parameter after c/s 18786.
Keir Fraser [Wed, 19 Nov 2008 12:40:23 +0000 (12:40 +0000)]
x86: Fix the clocksource= boot parameter after c/s 18786.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, hvm: Fix domain restore bug with Intel VLAPIC acceleration.
Keir Fraser [Tue, 18 Nov 2008 15:59:26 +0000 (15:59 +0000)]
x86, hvm: Fix domain restore bug with Intel VLAPIC acceleration.

r18383 mark video memory as ram, and make all valid pages migrated,
including vlapic page (0xFEE00), and share page(0xFFFFF).
An extra memory population for lapic page would override previous
mapping then cause HVM guest with vlapic acceleration hang.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Re-initialise HPET on resume from S3
Keir Fraser [Tue, 18 Nov 2008 15:55:14 +0000 (15:55 +0000)]
x86: Re-initialise HPET on resume from S3

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, time: Clean up platform timer initialisation.
Keir Fraser [Tue, 18 Nov 2008 15:39:31 +0000 (15:39 +0000)]
x86, time: Clean up platform timer initialisation.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, hvm: Implement interrupt routing to least priority processor.
Keir Fraser [Tue, 18 Nov 2008 11:16:36 +0000 (11:16 +0000)]
x86, hvm: Implement interrupt routing to least priority processor.

Instead of round robin the vcpu with the lowest processor
priority is selected for the interrupt. If multiple vcpus
share the same low priority then interrupts are distributed between
those round robin.

Signed-off-by: Juergen Gross <juergen.gross@fujitsu-siemens.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovtd: fix memory allocation from NUMA node for VT-d.
Keir Fraser [Tue, 18 Nov 2008 10:52:42 +0000 (10:52 +0000)]
vtd: fix memory allocation from NUMA node for VT-d.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years ago[IA64] Remove the useless big endian stuff.
dietmar.hahn@fujitsu-siemens.com [Tue, 18 Nov 2008 09:55:51 +0000 (10:55 +0100)]
[IA64] Remove the useless big endian stuff.

This patch removes all the useless big endian stuff from the mini-os.
Before there was an effort to support big endian for PV-guest.
But the big endian support was never gotten into the common parts of
the mini-os so it makes no sense to have this only in the ia64
specific sources. And as there is no open source big endian os and
porting our BS2000 os to ia64 was stopped, nobody wants that stuff
in the common minos.
So this looks ugly then and remove the big endian stuff.

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
17 years agohvm: Fix hvm_vcpu_reset_state() to act on specified domain, rather
Keir Fraser [Mon, 17 Nov 2008 15:55:56 +0000 (15:55 +0000)]
hvm: Fix hvm_vcpu_reset_state() to act on specified domain, rather
than current.

Signed-off-by: Liping Ke <liping.ke@intel.com>
17 years agotools: use sysfs interface to balloon driver if present
Keir Fraser [Mon, 17 Nov 2008 15:54:31 +0000 (15:54 +0000)]
tools: use sysfs interface to balloon driver if present

The pvops dom0 kernel does not expose the balloon driver via
/proc/xen, so use the sysfs interface.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
17 years ago[IA64] minios: Fix ctor and dtor sections.
dietmar.hahn@fujitsu-siemens.com [Mon, 17 Nov 2008 08:27:02 +0000 (09:27 +0100)]
[IA64] minios: Fix ctor and dtor sections.

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
17 years ago[IA64] minios: Clean up the hypervisor interface
dietmar.hahn@fujitsu-siemens.com [Mon, 17 Nov 2008 08:19:45 +0000 (09:19 +0100)]
[IA64] minios: Clean up the hypervisor interface

move all hypervisor calls to xencomm

Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
17 years ago[IA64] Fix a bug for XEN_VIRT_UC_BIT use.
Isaku Yamahata [Tue, 18 Nov 2008 01:33:55 +0000 (10:33 +0900)]
[IA64] Fix a bug for XEN_VIRT_UC_BIT use.

Only bit0 is used for dep later. So extract only used bit.

Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
17 years ago[IA64] Fix typo. (PALL -> PAL)
Isaku Yamahata [Mon, 17 Nov 2008 02:15:22 +0000 (11:15 +0900)]
[IA64] Fix typo. (PALL -> PAL)

s/PALL/PAL/

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
17 years agoRemove NR_PIRQS definition -- always use NR_IRQS.
Keir Fraser [Fri, 14 Nov 2008 14:33:25 +0000 (14:33 +0000)]
Remove NR_PIRQS definition -- always use NR_IRQS.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix to save CPU affinity for xm save/restore
Keir Fraser [Fri, 14 Nov 2008 14:27:51 +0000 (14:27 +0000)]
Fix to save CPU affinity for xm save/restore
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agovt-d: Fix ia64 build.
Keir Fraser [Fri, 14 Nov 2008 14:27:08 +0000 (14:27 +0000)]
vt-d: Fix ia64 build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: don't disable MSI in order to mask an IRQ
Keir Fraser [Thu, 13 Nov 2008 16:31:08 +0000 (16:31 +0000)]
x86: don't disable MSI in order to mask an IRQ

... as that's not really correct, and there are devices which can't
even cope with that. Instead, check whether an MSI IRQ can be masked,
and if it can't, treat it just like a level triggered IO-APIC IRQ.

There's one other bug fix in here, correcting an off-by-one error on
the entry_nr range check in __pci_enable_msix().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86, hvm: Provide access to limited VCPUOP_ hypercalls.
Keir Fraser [Thu, 13 Nov 2008 14:19:56 +0000 (14:19 +0000)]
x86, hvm: Provide access to limited VCPUOP_ hypercalls.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Use the shadow-code PT walker from the HAP functions
Keir Fraser [Thu, 13 Nov 2008 13:03:16 +0000 (13:03 +0000)]
x86: Use the shadow-code PT walker from the HAP functions

Replace the guts of the HAP pagetable walker with a call to the
newly-commonified walker from the shadow code.  This reduces
duplication, and gives HAP guests proper access control and A/D-bit
setting for memory accesses from the emulator

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agox86: Move the guest pagetable walker out of shadow/multi.c
Keir Fraser [Thu, 13 Nov 2008 13:02:08 +0000 (13:02 +0000)]
x86: Move the guest pagetable walker out of shadow/multi.c

Move the guest PT walker into its own file, and purge it of references
to the rest of the shadow code.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agox86: Move guest_l*e definitions into common code
Keir Fraser [Thu, 13 Nov 2008 13:01:22 +0000 (13:01 +0000)]
x86: Move guest_l*e definitions into common code

Move the definitions of guest pagetable types and the guest pagetable
walk record out of the shadow-code headers into asm-x86.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoxm: display domain id on domain creation
Keir Fraser [Thu, 13 Nov 2008 10:50:50 +0000 (10:50 +0000)]
xm: display domain id on domain creation

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agox86: add SSE-based copy_page()
Keir Fraser [Wed, 12 Nov 2008 12:04:15 +0000 (12:04 +0000)]
x86: add SSE-based copy_page()

In top of the highmem asstance hypercalls added earlier, this provides
a performance improvement of another 12% (measured on Xeon E5345) for
the page copying case.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: reduce GDT switching
Keir Fraser [Wed, 12 Nov 2008 12:01:35 +0000 (12:01 +0000)]
x86: reduce GDT switching

Both idle and HVM vCPU-s can easily run on the GDT mapped into general
hypervisor space (rather than that placed in per-vCPU virtual space).

This makes unnecessary some of the additions c/s 18520 did.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoxend, pciif: fix some indentation
Keir Fraser [Wed, 12 Nov 2008 11:50:25 +0000 (11:50 +0000)]
xend, pciif: fix some indentation

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agohvm: fix single stepping on debugger
Keir Fraser [Tue, 11 Nov 2008 11:47:03 +0000 (11:47 +0000)]
hvm: fix single stepping on debugger

The debuggee domain will die with unexpected trap
on single stepping of emulated instruction.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovmx: Clean up exception delivery logic.
Keir Fraser [Tue, 11 Nov 2008 11:35:00 +0000 (11:35 +0000)]
vmx: Clean up exception delivery logic.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: fix getvcpucontext for HVM segment registers
Keir Fraser [Tue, 11 Nov 2008 11:13:57 +0000 (11:13 +0000)]
x86: fix getvcpucontext for HVM segment registers

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovmx: Fix realmode exception delivery to correctly check stack pointer size.
Keir Fraser [Tue, 11 Nov 2008 11:10:59 +0000 (11:10 +0000)]
vmx: Fix realmode exception delivery to correctly check stack pointer size.

Bug tracked down by Tim Deegan <tim.deegan@citrix.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovtd cleanup: change some function return types to void
Keir Fraser [Tue, 11 Nov 2008 11:07:21 +0000 (11:07 +0000)]
vtd cleanup: change some function return types to void

iommu_suspend(), iommu_resume(), iommu_enable() translation don't have
meaningful return values.  Changed their function types to void.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agoxend: Restore CPU affinity on domain resume.
Keir Fraser [Tue, 11 Nov 2008 11:06:27 +0000 (11:06 +0000)]
xend: Restore CPU affinity on domain resume.

Move affinity-setting logic into its own function and call from
relevant places.

From: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agominios: add a barebone net/if.h
Keir Fraser [Tue, 11 Nov 2008 11:03:58 +0000 (11:03 +0000)]
minios: add a barebone net/if.h

net/if.h is a standard header but unfortunately lwip doesn't provide
it for any target but linux. Therefore I am adding a net/if.h, with an
empty implementation of the declared functions.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agovtd: fix interrupt remapping to handle SMI RTE's with uninitialized
Keir Fraser [Mon, 10 Nov 2008 10:41:41 +0000 (10:41 +0000)]
vtd: fix interrupt remapping to handle SMI RTE's with uninitialized
reserved fields

Some BIOS does not zero out reserve fields in IOAPIC RTE's.
clear_IO_APIC() zeroes out all RTE's except for RTE with MSI delivery
type.  This is a problem when the host OS converts SMI delivery type
to some other type but leaving the reserved field uninitialized.  This
can cause interrupt remapping table out of bound error if "format"
field is 1 and the uninitialized "index" field has a value that that
is larger than the maximum index of interrupt remapping table.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>=
17 years agox86, vmx realmode: Stack manipulation on interrupt/exception injection
Keir Fraser [Fri, 7 Nov 2008 17:06:21 +0000 (17:06 +0000)]
x86, vmx realmode: Stack manipulation on interrupt/exception injection
should respect SS size, not CS size.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>